#include <iostream>
using namespace std;
// 轮胎类
class tyre_t {
  private:
    int m_radius; // 半径
    int m_width;  // 宽度
  public:
    tyre_t(int radius, int width);
    void show() const;
};

tyre_t::tyre_t(int radius, int width) : m_radius(radius), m_width(width)
{
}
void tyre_t::show() const
{
    cout << "轮毂半径：" << this->m_radius << "inch" << endl;
    cout << "轮胎宽度：" << this->m_width << "mm" << endl;
}

// 引擎类
class engine_t {
  private:
    float m_displacement;

  public:
    engine_t(float displacement = 2.0);
    void show() const;
};
engine_t::engine_t(float displacement) : m_displacement(displacement)
{
}
void engine_t::show() const
{
    cout << "排量：" << this->m_displacement << "L" << endl;
}
// 汽车类
class care_t {
  private:
    int      m_price;  // 价格
    tyre_t   m_tyre;   // 轮胎
    engine_t m_engine; // 引擎
  public:
    care_t(int price, int radius, int width);
    void show() const;
};
/*指明m_tyre对象的初始化方式*/
care_t::care_t(int price, int radius, int width) : m_price(price), m_tyre(radius, width)
{
}
void care_t::show() const
{
    cout << "价格：" << this->m_price << "￥" << endl;
    this->m_tyre.show();
    this->m_engine.show();
}
int main()
{
    care_t car(200000, 19, 245);
    car.show();
    return 0;
}